package com.jackson.rocketmqdemo.service.Consumer;

/*
 * Author: JacksonCoder
 * FileName: MessageProducer
 * Version: 1.0.0
 * Date: 2025/4/28
 */

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;

@Service
@RocketMQMessageListener(
        topic = "demo-topic",
        consumerGroup = "demo-consumer-group",
        messageModel = MessageModel.CLUSTERING // Or BROADCASTING
)
public class MessageConsumer implements RocketMQListener<String> {


    @Override
    public void onMessage(String message) {
        System.out.println("Received message: " + message);
    }
}
